<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@ page import="domain.User" %>
<%@ include file="time.jsp" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>登陆成功</title>
</head>
<body style="text-align:center;">
<%

    Object obj = session.getAttribute("user");
    User user = (User) obj;
    if (null == obj) {
%>
您尚未登陆，请登录！
<a href="login.jsp" name="login">去登录</a>
<a href="register.jsp" name="register">跳转注册</a>
<%
} else {
%>
<%--<h2>登录成功!</h2>--%>
<font color="blue" size="5" family="Microsoft JhengHei">
    登录成功!<br/>
    <%
        String username = user.getUsername();
        session.setAttribute("user", user);
    %>
    欢迎您：<%=username %><br/>
    <a href="user_info.jsp" name="show">显示信息</a><br>
    <a href="user_info_add.jsp" name="add">信息补充</a><br>
    <a href="exit.jsp" name="exit">退出登录</a>
</font><br>
<%}%>
</body>
</html>